package org.fioma.tree;

import java.io.BufferedWriter;
import java.io.IOException;

public interface Node<L> {

	public boolean isLeaf();

	public InternalNode<?> getParent();

	public void setParent(InternalNode<?> parent);

	public L getLabel(); // get the label text w of the incoming edge

	public void setLabel(L label); // set the label text w of the incoming edge

	// add a new node in the position pos of the current label.
	// The letter in the position pos of the current label will belong to the current label Node
	public Leaf<?> addNode(int pos, L word);

	public short getLengthLabel();

//	public byte[] getSuffix(); // get the text of the path from root to this node

//	public byte[] getWord(byte start, byte end); // get substring of the text of the path from this node to root parent edge (reverse of suffix)

	public void addWord(L word);

	public int addSuffix(L suffix);

	public void printWords(BufferedWriter bw, L prefix) throws IOException;

	// try to find out the word in the subtree rooted by this node
	public boolean find(L word);

}
